package com.hundsun.fmbp.deploy.constants;

/**
 * 升级部署的应用
 * 
 * @ClassName: DeployAppEnum
 * @author chenc
 * @date 2017年2月23日 下午4:25:37
 *
 */
public enum DeployAppEnum {
    dispatcher1, dispatcher2, nk, fsk, crk, common;

    public static DeployAppEnum valueOf(int ordinal) {
        if (ordinal < 0 || ordinal >= values().length) {
            throw new IndexOutOfBoundsException("Invalid ordinal");
        }
        return values()[ordinal];
    }

    public static String deployName(int ordinal) {
        if (ordinal == dispatcher1.ordinal()) {
            return "dispatch";
        } else if (ordinal == dispatcher2.ordinal()) {
            return "dispatch2";
        } else if (ordinal == nk.ordinal()) {
            return "management";
        } else if (ordinal == fsk.ordinal()) {
            return "fsk";
        } else if (ordinal == crk.ordinal()) {
            return "crk";
        }
        return "";

    }
}
